import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'
import '@/components/icons'
import {
  mapGetters
} from 'vuex'

Vue.config.productionTip = process.env.NODE_ENV !== 'development'
Vue.config.devtools = process.env.NODE_ENV === 'development'

if (!process.env.IS_WEB)
Vue.use(require('vue-electron'))
Vue.config.productionTip = false
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true'
// 定义全局点击函数
Vue.prototype.globalClick = function (callback) {
    document.getElementById('main').onclick = function () {
        callback();
    };
};
// 定义全局点击函数
Vue.prototype.playlistClick = function (callback) {
    document.getElementById('playlist').onclick = function () {
        callback();
    };
};
/**
 * 计算列表布局容器的高度
 */
Vue.prototype.computeListLayoutContainerSize = function () {
  document.getElementsByClassName('el-container')[0].style.height = window.innerHeight + 'px'
}

/**
 * 绑定window的size变动事件
 */
Vue.prototype.bindSizeChange = function () {
  var $this = this
  window.onresize = function () {
    $this.computeListLayoutContainerSize()
  }
}

Vue.use(ElementUI)
new Vue({
  el: '#app',
  router,
  store,
  data () {
    return {
      client: null
    }
  },
  components: {
    App
  },
  computed: {
    ...mapGetters([])
  },
  watch: {
  },
  created () {
  },
  methods: {
  },
  template: '<App/>'
}).$mount('#app');
